Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Oct 19, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on enhancing the tracking functionality in the thirdweb SDK by refining the analytics tracking methods for wallet connections and transactions, ensuring better data collection and reporting.

Detailed summary

  • Updated imports for trackConnect and trackPayEvent to specific paths.
  • Introduced trackConnect and trackPayEvent functions with detailed parameters.
  • Added tracking calls in wallet connection and transaction methods.
  • Implemented tests for trackConnect, track, trackPayEvent, and trackLogin.
  • Enhanced error handling and response structures in tracking functions.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link

changeset-bot bot commented Oct 19, 2024

⚠️ No Changeset found

Latest commit: 4f22e2b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 0:50am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 0:50am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 0:50am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 0:50am

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 19, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@codecov
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

Attention: Patch coverage is 52.52101% with 113 lines in your changes missing coverage. Please review.

Project coverage is 45.34%. Comparing base (319a203) to head (4f22e2b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/wallets/injected/index.ts 0.00% 55 Missing ⚠️
...es/thirdweb/src/wallets/coinbase/coinbaseWebSDK.ts 0.00% 24 Missing ⚠️
.../thirdweb/src/wallets/wallet-connect/controller.ts 0.00% 24 Missing ⚠️
packages/thirdweb/src/wallets/create-wallet.ts 0.00% 5 Missing ⚠️
...ges/thirdweb/src/auth/core/verify-login-payload.ts 90.47% 2 Missing ⚠️
...dweb/src/wallets/in-app/core/wallet/in-app-core.ts 33.33% 2 Missing ⚠️
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5086      +/-   ##
==========================================
+ Coverage   45.30%   45.34%   +0.04%     
==========================================
  Files        1060     1064       +4     
  Lines       54874    55030     +156     
  Branches     3957     3965       +8     
==========================================
+ Hits        24860    24954      +94     
- Misses      29322    29384      +62     
  Partials      692      692              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 319a203
packages 40.33% <52.52%> (+0.07%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
packages/thirdweb/src/analytics/track/connect.ts 100.00% <100.00%> (ø)
packages/thirdweb/src/analytics/track/index.ts 100.00% <100.00%> (ø)
packages/thirdweb/src/analytics/track/pay.ts 100.00% <100.00%> (ø)
packages/thirdweb/src/analytics/track/siwe.ts 100.00% <100.00%> (ø)
...ckages/thirdweb/src/analytics/track/transaction.ts 100.00% <100.00%> (ø)
...act/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx 0.08% <ø> (ø)
...nectWallet/screens/Buy/DirectPaymentModeScreen.tsx 0.93% <ø> (ø)
...onnectWallet/screens/Buy/TransactionModeScreen.tsx 0.96% <100.00%> (ø)
...web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx 2.29% <ø> (ø)
...nectWallet/screens/Buy/swap/ConfirmationScreen.tsx 1.03% <ø> (ø)
... and 10 more

... and 3 files with indirect coverage changes

Copy link
Member

@joaquim-verges joaquim-verges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to change the tx tracking approach

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.81 KB (0%) 857 ms (0%) 346 ms (+18.36% 🔺) 1.3 s
thirdweb (cjs) 102.66 KB (0%) 2.1 s (0%) 593 ms (-18.26% 🔽) 2.7 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 92 ms (+533.07% 🔺) 189 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 80 ms (+1728.63% 🔺) 90 ms
thirdweb/react (minimal + tree-shaking) 17.33 KB (-0.21% 🔽) 347 ms (-0.21% 🔽) 145 ms (+222.86% 🔺) 492 ms

*/
async function trackSiweEvent(
event: SiweEvent & {
action: "login:attempt";
Copy link
Member

@joaquim-verges joaquim-verges Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i read this as 'the event before verifying any payload' - but really its the login action, and that can be success of failed if theres an error right?

Copy link
Contributor Author

@gregfromstl gregfromstl Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we wanted a single action label and we'd tell from the error if it succeeded or not?

Copy link
Member

@joaquim-verges joaquim-verges Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, was just thrown off by the 'attempt' label.

would have just called it action: login or action: authenticate since this is not just an attempt but actually a fully succesful/failed login

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Oct 23, 2024
Copy link
Contributor Author

gregfromstl commented Oct 23, 2024

Merge activity

  • Oct 22, 8:26 PM EDT: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Oct 22, 8:26 PM EDT: A user added this pull request to the Graphite merge queue.
  • Oct 22, 8:50 PM EDT: A user merged this pull request with the Graphite merge queue.

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on improving the analytics tracking for wallet connections and transactions within the `thirdweb` library. It refines the tracking methods by introducing specific tracking functions for connections and payments, enhancing the data sent for analytics.

### Detailed summary
- Deleted `track.ts` file.
- Updated import paths for `trackConnect` and `trackPayEvent` in several files.
- Introduced `trackConnect` and `trackPayEvent` functions with detailed parameters.
- Added tracking functionality to wallet connection methods in `in-app` and `coinbase` wallets.
- Enhanced error handling and data structure in tracking functions.
- Added tests for `trackConnect`, `trackPayEvent`, and `trackLogin` functionalities.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Adds the pull request to Graphite's merge queue. packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants